%Plots the gap-closing trade size for all currencies for the recent period
%for which we have microstructure data
function fig_CIP_arbsizeDailyVolumeRobust(datesExtras, selectorNonHolidays, WelfareArbs, optfig)

if optfig.plotfig == 1
    
    [fontname,dimension,lw,folder,color,style,marker,markersize,fontsize_tit,fontsize_ax,fontsize_lab,fontsize_leg] = fn_optfig(optfig);
    
    f0 = figure('Units','inches','Position',dimension);
        
    %Daily volumes taken from BIS Triennial Survey
    dailyVolumeVec = [127e9 167e9 105e9 416e9 260e9];
    
    plot(datesExtras(selectorNonHolidays,:),abs(WelfareArbs(:,2))*100*1e6/dailyVolumeVec(1),'Color',color{1},'LineStyle', style{1},'LineWidth',lw); hold on;
    plot(datesExtras(selectorNonHolidays,:),abs(WelfareArbs(:,4))*100*1e6/dailyVolumeVec(2),'Color',color{3},'LineStyle', style{2},'LineWidth',lw); hold on;
    plot(datesExtras(selectorNonHolidays,:),abs(WelfareArbs(:,6))*100*1e6/dailyVolumeVec(3),'Color',color{4},'LineStyle', style{3},'LineWidth',lw); hold on;
    plot(datesExtras(selectorNonHolidays,:),abs(WelfareArbs(:,8))*100*1e6/dailyVolumeVec(4),'Color',color{5},'LineStyle', style{4},'LineWidth',lw); hold on;
    plot(datesExtras(selectorNonHolidays,:),abs(WelfareArbs(:,10))*100*1e6/dailyVolumeVec(5),'Color',color{6},'LineStyle',style{5},'LineWidth',lw); hold on;
    
    dateaxis('x',2)
    ytickformat('%g')
    xlabel('Date','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname)
    ylabel('$m^\star$ (percent of Daily Volume)','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname)
    title('Normalized Gap-closing Trade', 'interpreter','latex','FontSize',fontsize_tit,'FontName',fontname)
    grid; axis tight; box off;

    legendCell = {'AUD', 'GBP', 'CAD', 'EUR', 'JPY'};
    legend(legendCell,'interpreter','latex','FontSize',fontsize_leg,'FontName',fontname,'Location','best')
    legend boxoff
end

name = '03_GapCloseSizeDailyVolumeRobust';
print(f0,'-depsc','-painters','-noui','-r600',[folder,name,'.eps'])

end